package com.jfinal.weixin.ext.menu;  

import java.util.ArrayList;
import java.util.List;
  
/** 
 * 复杂按钮（父按钮） 
 *  
 * @author 张龙 
 * @date 2017-12-26 
 */  
public class ComplexButton extends Button {
	private List<Button> sub_button = new ArrayList<>(5);
	public ComplexButton(String name){
		this.setName(name);
	}
	public void addButton(Button button){
		if(this.sub_button.size()>=5){
    		throw new RuntimeException("创建的菜单数不能大于5个");
    	}
		this.sub_button.add(button);
	}
	public List<Button> getSub_button() {
		return sub_button;
	}
	public void setSub_button(List<Button> sub_button) {
		this.sub_button = sub_button;
	}
	
}  